package com.gzl.demo.controller;

import com.gzl.demo.utils.CalendarUtil;
import com.gzl.demo.utils.JodaTimeUtils;

import java.time.LocalDateTime;
import java.util.Calendar;

/**
 * <p>
 *
 * </p>
 *
 * @author gzl
 * @since 2021/7/8
 */
public class Test1{
    public static void main(String[] args) {
        /*LocalDateTime firstDay = JodaTimeUtils.withTimeAtStartOfNextMonth(LocalDateTime.now());
        LocalDateTime day = firstDay.plusDays(32- 1);
        System.out.println(day);
        //expire = CalendarUtil.tiemDifference(localDateTime, day);


        int i = Calendar.getInstance().get(Calendar.DAY_OF_MONTH);
        System.out.println(i);*/
        Integer[] intArray = { 1, 2, 3, 4, 5 };
        //System.out.println();
        printArray( intArray  );


    }

    public static < T> void printArray( T[] inputArray )
    {
        // 输出数组元素
        for ( T element : inputArray ){
            System.out.printf( "%s ", element );
        }
        System.out.println();
    }

    // 比较三个值并返回最大值
    public static <T extends Comparable> T maximum(T x, T y, T z)
    {
        T max = x; // 假设x是初始最大值
        if ( y.compareTo( max ) > 0 ){
            max = y; //y 更大
        }
        if ( z.compareTo( max ) > 0 ){
            max = z; // 现在 z 更大
        }
        return max; // 返回最大对象
    }


}
